@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/clothInfo.css?v=1.0.2">
    <style>
        .seek_lab{width:190px;}
    </style>
    <div class="container">
        <div class="lining-btn">
            <h3 style="float:left;">面辅料档案</h3>
            <a class="lining-a lining-a1" href="/admin/fabric_unit_conversion">面辅料采购单位换算</a>
            <a class="lining-a" href="/admin/ingred_data">辅料资料</a>
            <a class="lining-a" href="javascript:;" style="background:#27c24c;">面料资料</a>
            <a class="lining-a lining-a2" href="/admin/fabric_color_define">面料色卡号定义</a>
            <a class="lining-a" href="/admin/cloth_info">面辅料类型</a>
        </div>
        <ul class="lining-ul">
            {{--面料资料--}}
            <li id="material" class="lining-li">
                <form action="/admin/fabric_data" method="get" >
                    <p class="seek_p">
                        <label class="seek_lab">子类：
                            <select class="seek_sel web_select1" name="sub_cate">
                                <option value="">请选择</option>
                                @if(count($cloths) > 0)
                                    @foreach($cloths as $k=>$v)
                                        <option value="{{ $v->id }}"
                                                @if(isset($requestInfos['sub_cate']) && $requestInfos['sub_cate']==$v->id)
                                                selected
                                                @endif
                                        >{{ $v->name }}</option>
                                    @endforeach
                                @endif
                            </select>
                        </label>
                        <label class="seek_lab">小类：
                            <select class="seek_sel web_select2" name="small_cate">
                                <option value="">请选择</option>
                            </select>
                        </label>
                        {{--<label class="seek_lab">面料号：--}}
                            {{--<select class="seek_sel" name="goods_num">--}}
                                {{--@if(!empty($requestInfos['goods_num']) && isset($requestInfos['goods_num']))--}}
                                    {{--<option value="{{ $requestInfos['goods_num'] }}" >{{ $requestInfos['goods_num'] }}</option>--}}
                                {{--@else--}}
                                    {{--<option value="">请选择</option>--}}
                                {{--@endif--}}
                                {{--@if(count($goods_num0)>0)--}}
                                    {{--@foreach($goods_num0 as $k=>$v)--}}
                                        {{--<option value="{{ $v->goods_num }}" >{{ $v->goods_num }}</option>--}}
                                    {{--@endforeach--}}
                                {{--@endif--}}

                            {{--</select>--}}
                        {{--</label>--}}
                        <label class="seek_lab" >供应商：<input class="ingred_sel seek_sel" type="text" autocomplete="off" autocorrect="off" placeholder="供应商" value="{{$requestInfos['supplier_name']}}" name="supplier_name" /></label>
                        <label class="seek_lab1">供应商货号：<input class="seek_sel" type="text" autocomplete="off" autocorrect="off" placeholder="供应商货号" value="{{$requestInfos['fabric_num']}}" name="fabric_num" /></label>
                        <button type="submit" class="btn bt_del btn-info">搜索</button>
                        <a class="btn bt_del btn-info" href="javascript:;" onclick="emptyFabric()">清空</a>
                    </p>

                </form>
                <div class="fabric-choose">
                    <span>共<span class="mate_count info_sum">{{$fabric_count}}</span>条信息</span>
                    <a class="btn bt_a btn-primary" href="/admin/create_lining">添加</a>
                </div>
                <div class="fabric_div">
                    <table class="fabric" border="1" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>供应商</td><td>供应商货号</td><td>参考采购价/元</td><td>采购单位</td><td>规格(门幅)</td><td>排版(门幅)</td>
                            <td>主要成分</td><td>子类</td><td>小类</td><td>使用年份</td><td>使用季节</td>
                            <td>录入人</td><td>录入时间</td><td>修改人</td><td>修改时间</td><td>操作</td>
                        </tr>
                        @foreach($fabric_infos as $k => $v)
                            <tr class="fabric_{{$v->id}} lists">
                                <td>{{$v->supplier_name or ''}}</td>
                                <td>{{$v->fabric_num}}</td>
                                <td>{{$v->refer_price}}</td>
                                <td>{{$v->purchase_data}}</td>
                                <td>{{$v->specification}}</td>
                                <td>{{$v->typesetting}}</td>
                                <td>{{$v->ingredient}}</td>
                                <td>{{$cate_infos[$v->sub_cate] or ""}}</td>
                                <td>{{$cate_infos[$v->small_cate] or "" }}</td>
                                <td>{{$v->use_year}}</td>
                                <td>
                                    @if($v->use_season==0)
                                        未选择
                                    @elseif($v->use_season==1)
                                        春季
                                    @elseif($v->use_season==2)
                                        夏季
                                    @elseif($v->use_season==3)
                                        秋季
                                    @elseif($v->use_season==4)
                                        冬季
                                    @elseif($v->use_season==5)
                                        四季
                                    @endif
                                </td>
                                <td>{{$admin_info[$v->entry_person_id] or ''}}</td>
                                <td>{{$v->created_at}}</td>
                                <td>
                                    @if(!$v->modify_person_id)
                                        未修改
                                    @else
                                        {{$admin_info[$v->modify_person_id]}}
                                    @endif
                                </td>
                                <td>@if($v->updated_at !='0000-00-00 00:00:00'){{$v->updated_at}}@endif</td>
                                <td>
                                    <a href="/admin/fabric_edit?id={{$v->id}}">修改</a>
                                    {{--<a href="javascript:;" onclick="window.open('/admin/fabric_edit?id={{$v->id}}')">修改</a>--}}
                                    <a href="javascript:;" onclick="delFabric({{$v->id}})">删除</a>
                                </td>
                            </tr>
                        @endforeach
                    </table>
                </div>
            </li>
            <span style="float:right;">
                <div style="float: right;margin:20px 0;"><button class="btn btn-info" onclick="returnPage()" style="float:right;">跳转</button><input type="text" class="form-control returnPage" style="width:6rem;float: right;margin:0 5px;"></div>
                {{$fabric_infos->appends(['use_year'=>$requestInfos['use_year'],'supplier_name'=>$requestInfos['supplier_name'],'use_season'=>$requestInfos['use_season'],'goods_num'=>$requestInfos['goods_num'],'sub_cate'=>$requestInfos['sub_cate'],'small_cate'=>$requestInfos['small_cate'],'fabric_num'=>$requestInfos['fabric_num']])->links()}}
            </span>
        </ul>
    </div>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/fabricData.js?v=1.0.3"></script>
@endsection
